<!DOCTYPE html >
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="icon" type="image/gif" href="slike/animated_favicon1.gif">
<script src="skripte/Cookies.js"></script>
<script src="skripte/proba1.js"></script>
<script src="jQuery/jquery-1.10.2.js"></script>
<script src="skripte/urlParam.js"></script>
<LINK href="stilovi/pristup.css" rel="stylesheet" type="text/css">
<LINK href="stilovi/login.css" rel="stylesheet" type="text/css">
<LINK href="stilovi/coda-slider.css" rel="stylesheet" type="text/css">
<LINK href="stilovi/templatemo_style.css" rel="stylesheet" type="text/css">

<link rel="icon" type="image/gif" href="slike/animated_favicon1.gif">

<title>Odaberite sa kojiom ulogom želite ući...</title>

</head>
<body>

<div id="slider">
 
	<div id="templatemo_main">
    	<ul id="social_box">
            <h1> Javna saobraćajna mreža Bosne i Hercegovine </h1>         
        </ul>
        
        <div id="content">
     
            <div class="scroll">
                <div class="scrollContainer">
                
                    <div class="panel" id="home">             
                        <input type="button" class="btn" value="Nazad" onclick="location.href='index.html#login';">
                        <div id="naslov">
						<h4>Imate više uloga, sa kojom želite pristupiti stranici<img src="slike/bus-icon1bw.png"></h4>
						</div>
						<div id="roleDiv">
						</div>
						<script type="text/javascript">
						var korisnik=readCookie('login');
						if(korisnik==null) window.location = "login.html";

						function dodajDugme(rola)
						{
							var gdje="window.location='"+rola+".html'"
							$('#roleDiv').append("<button type='button' id="+rola+" onClick="+gdje+">"+rola+"</button><br>");
						}
						var req = createRequest(); // defined above
						//Create the callback:
						req.onreadystatechange = function() {
						if (req.readyState != 4) return; // Not there yet
						if (req.status != 200) {
						// Handle request failure here...
						return;
						}
						//Request successful, read the response
						var respXML= req.responseXML;
						var r1 = respXML.getElementsByTagName("naziv");
						//... and use it as needed by your app.
						//alert(r2);
						for (var i=0;i<r1.length;i++)
					    {
							 var rol=r1[i].childNodes[0].nodeValue;
	 						 dodajDugme(rol);
	  					}
	  
						return;
						}
						req.open("GET","korisno/roles/moje/?korisnik="+korisnik, true);
						req.send();
						</script>
						
        	        </div> 
        	            
     
			</div>
 
        
        </div> 
    </div>
    
    </div> 
</div>

</body>
</html>